import request from "@/utils/request";

// 捐赠记录接口参数类型
interface DonationRecordParams {
  pageNum: number | string;
  pageSize: number | string;
  projectId: number | string;
}

// 捐赠记录项类型
export interface DonationRecord {
  id: number;
  projectId: number;
  donorName: string;
  userId: number;
  donationAmount: number;
  donationMessage: string;
  donationTime: string;
}

// 捐赠记录分页响应类型
interface DonationRecordResponse {
  list: DonationRecord[];
  total: number;
}

/**
 * 获取捐赠记录分页列表
 * @param params 分页参数
 */
export function getDonationRecords(params: DonationRecordParams) {
  return request<DonationRecordResponse>({
    url: "/api/v1/donation-record/page",
    method: "GET",
    data: params,
  });
}
